<p>Calling <code>toString()</code> or <code>clone()</code> on an object should always return a string or an object. Returning <code>null</code> instead contravenes the method's implicit contract.</p>
<h2>Noncompliant Code Example</h2>

<pre>
public override string ToString () {
  if (this.collection.Count == 0) {
    return null; // Noncompliant
  } else {
    // ...
 </pre>
<h2>Compliant Solution</h2>

<pre>
public override string ToString () {
  if (this.collection.Count == 0) {
    return "";
  } else {
    // ...
 </pre>
<h2>See</h2>

<ul>
<li> <a href="http://cwe.mitre.org/data/definitions/476.html">MITRE CWE-476</a> - NULL Pointer Dereference
</li></ul>
